﻿
@{
    ViewBag.Title = "用户登录";
    Layout = "~/Views/Shared/_Login.cshtml";
}

<div class="tc-panel-back"></div>
<div class="tc-panel tc-login">
    <form id="dataForm">
        <div class="tc-login-logo">
            <a href="/home/index@(ViewBag.Suffix)"><img src="~/Content/img/login_logo.png" alt="logo" /></a>
        </div>
        <div class="tc-login-option">
            <h1>登录</h1>
        </div>
        <div class="tc-login-option">
            <input type="text" placeholder="手机号码/账号" name="phone" class="layui-input">
        </div>
        <div class="tc-login-option">
            <input type="password" placeholder="密码" name="passWord" class="layui-input">
        </div>
        @*<div class="tc-login-option">
            <input type="text" placeholder="图形验证码" name="vecode" class="layui-input tc-login-option-small">
            <img src="/Content/img/img.jpg" class="tc-login-img" id="vecode_show" />
        </div>*@
        <div class="tc-login-option">
            <a href="/login/register@(ViewBag.Suffix)" class="tc-left">注册账号</a>
            <a href="/login/back@(ViewBag.Suffix)" class="tc-right">忘记密码？</a>
        </div>
        <div class="tc-login-option">
            <a class="layui-btn tc-login-w100" id="submit" onclick="javascript: { login(); }">登录</a>
        </div>
    </form>
</div>

<script>
    var msg_type = '@ViewBag.Type';
    $(function () {
        if (msg_type == "loginout") {
            layer.msg('登录过期，请重新登录');
        }
    });
    function login() {
        var paras = $('#dataForm').getForm();
        $.post('/Login/UserLoginResult', paras, function (result) {
            layer.msg('登录成功，正在加载中...');
            setTimeout(function () { window.location = '/home/index'; }, 1000);
        });

    };
</script>